package com.lagou.mapper;

import com.lagou.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author zhouzijia
 * @version 1.0
 * @description
 * @date 2020/11/8 15:12
 */

public interface UserMapper {

    List<User> findAll();


    List<User> findone(User user);

    @Insert("insert into user values(#{id} , #{userName})")
    void addUser(User user);

    @Update("update user set username = #{userName} where id = #{id}")
    int updateUser(User user);

    @Select("select * from user")
    List<User> selectUser();

    @Delete("delete from user where id = #{id}")
    void deleteUser(Integer id);


    @Select("select * from user where id = #{id}")
    User findUserById(Integer id);

}
